import request from "@/utils/request"

export default{
    // 员工分页
    search(page, size, searchMap){
        return request({
            url: `/staff/list/search/${page}/${size}`,
            method: 'post',
            data: searchMap
        })
    },
    // 新增员工
    add(pojo){
        return request({
            url: '/staff',
            method: 'post',
            data: pojo
        })
    },
    // 根据id查找员工
    getById(id){
        return request({
            url: `/staff/${id}`,
            method: 'get'
        })
    },
    // 更新员工信息
    update(pojo){
        return request({
            url: `/staff/${pojo.id}`,
            method: 'put',
            data: pojo
        })
    },
    // 删除员工
    deleteById(id){
        return request({
            url: `/staff/${id}`,
            method: 'delete'
        })
    }
}